package com.guo.book1.singleduty;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
//@Builder
@AllArgsConstructor
public class JavaDiscountCourse extends JavaCourse {
    /**
     * 用于解决Lombok的Builder无法Build父类属性问题
     */
    @Builder(toBuilder = true)
    public JavaDiscountCourse(String name, Double price, Integer quantity) {
        super(name, price, quantity);
    }

    public Double getPrice() {
        return super.getPrice();
    }

    public Double getDiscountPrice() {
        return super.getPrice() * 0.5;
    }
}
